package com.cloudshop.service.goods.controller;

import com.cloudshop.service.common.enums.RequestEnum;
import com.cloudshop.service.goods.feign.UserFeign;
import java.util.HashMap;
import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Goods Demo Controller.
 *
 * @author 宫新程
 * @since 2019/3/29 15:41
 */
@RestController
public class DemoController {

  @Resource private UserFeign userFeign;

  /** 测试 Controller. */
  @GetMapping("/demo")
  public Object demo() {
    Map<String, Object> result = new HashMap<>();
    result.put("success", true);
    result.put("data：", this.getClass().getName());
    return result;
  }

  /** 测试使用Feign调用User服务. */
  @GetMapping("/get-name")
  public Object getUserName() {
    return userFeign.getUserName("GXC");
  }
}
